-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: calculate network id #212
Conversation
cmd/run.go
Outdated
reorgDetectorL2 *reorgdetector.ReorgDetector, | ||
l2Client *ethclient.Client, | ||
) *bridgesync.BridgeSync { | ||
if !isNeeded([]string{cdkcommon.RPC, cdkcommon.AGGSENDER}, components) { | ||
return nil | ||
} | ||
|
||
ethermanClient, err := newEtherman(c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of passing c config.Config
to be able to create a ethClient, inject the etherClient. There are 2 functions on run.go
that create the common instance for all classes:
runL1ClientIfNeeded
runL2ClientIfNeeded
cmd/run.go
Outdated
@@ -77,8 +77,8 @@ func start(cliCtx *cli.Context) error { | |||
|
|||
l1InfoTreeSync := runL1InfoTreeSyncerIfNeeded(cliCtx.Context, components, *c, l1Client, reorgDetectorL1) | |||
claimSponsor := runClaimSponsorIfNeeded(cliCtx.Context, components, l2Client, c.ClaimSponsor) | |||
l1BridgeSync := runBridgeSyncL1IfNeeded(cliCtx.Context, components, c.BridgeL1Sync, reorgDetectorL1, l1Client) | |||
l2BridgeSync := runBridgeSyncL2IfNeeded(cliCtx.Context, components, c.BridgeL2Sync, reorgDetectorL2, l2Client) | |||
l1BridgeSync := runBridgeSyncL1IfNeeded(cliCtx.Context, components, *c, reorgDetectorL1, l1Client) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that is not related to your PR, but renaming c
for config
or even for cfg
would be really nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM, left a minor comments.
Co-authored-by: Stefan Negovanović <[email protected]>
Co-authored-by: Stefan Negovanović <[email protected]>
Co-authored-by: Stefan Negovanović <[email protected]>
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
* feat: calculate network id * feat: refactor * feat: refactor * feat: separeted function to obtain the rollupID * feat: obtain RollupID without etherman instance * Update etherman/etherman.go Co-authored-by: Stefan Negovanović <[email protected]> * Update etherman/etherman.go Co-authored-by: Stefan Negovanović <[email protected]> * Update etherman/etherman.go Co-authored-by: Stefan Negovanović <[email protected]> --------- Co-authored-by: joanestebanr <[email protected]> Co-authored-by: Stefan Negovanović <[email protected]>
* feat: calculate network id (#212) * feat: calculate network id * feat: refactor * feat: refactor * feat: separeted function to obtain the rollupID * feat: obtain RollupID without etherman instance * Update etherman/etherman.go Co-authored-by: Stefan Negovanović <[email protected]> * Update etherman/etherman.go Co-authored-by: Stefan Negovanović <[email protected]> * Update etherman/etherman.go Co-authored-by: Stefan Negovanović <[email protected]> --------- Co-authored-by: joanestebanr <[email protected]> Co-authored-by: Stefan Negovanović <[email protected]> * fix: typo --------- Co-authored-by: joanestebanr <[email protected]> Co-authored-by: Stefan Negovanović <[email protected]> Co-authored-by: Stefan Negovanović <[email protected]>
Description
Calculate network ID instead of reading it from config